import apiUrl from '../base'
import axios from '@/libs/axios'
const WorkstationLedger = {
  // 工点列表
  workstationLedgerList(prames) {
    return axios.post(`${apiUrl.base}v1/WorkstationLedger/list`, prames)
  },
  // 风险等级
  dictList(prames) {
    return axios.post(`${apiUrl.base}v1/Dict/list`, prames)
  },
  //风险类型
  riskTypeTree() {
    return axios.get(`${apiUrl.risk}/v1/riskInfoLib/queryRiskTypeTree`, '')
  },
  // 工点详情
  ledgerDetail(id) {
    return axios.get(`${apiUrl.base}/v1/WorkstationLedger/detail/${id}`, '')
  },
  // 编辑工点
  ledgerEdit(parmes) {
    return axios.post(`${apiUrl.base}/v1/WorkstationLedger/edit`, parmes)
  },
  // 新增工点
  ledgerAdd(parmes) {
    return axios.post(`${apiUrl.base}/v1/WorkstationLedger/add`, parmes)
  },
  // 项目名称列表
  projectGetAll(parmes) {
    return axios.post(`${apiUrl.base}/v1/Project/getAll`, parmes)
  },
  // 专业类型列表
  professionalTypeList(parmes) {
    return axios.post(`${apiUrl.base}/v1/ProfessionalType/list`, parmes)
  },
  //检查是否需要专业类型
  existWBS(parmes) {
    return axios.post(`${apiUrl.base}/v1/Menu/existWBS`, parmes)
  },
  // 删除工点
  ledgerDelete(data) {
    // return axios.delete(`${apiUrl.base}v1/WorkstationLedger/batchDelete`,data)
    return axios.request({
      url: `${apiUrl.base}v1/WorkstationLedger/batchDelete`,
      data,
      method: 'delete'
    })
  },
  // 下载模板
  ledgerImportExcel(parmes) {
  return axios.post(`${apiUrl.base}/v1/WorkstationLedger/importExcel`, parmes,{timeout: 1000 * 10 * 2})
  },
  //错误数据再次保存
  workstationLedgerimportObject(data) {
  return axios.post(`${apiUrl.base}/v1/WorkstationLedger/importObject`,data,{timeout: 1000 * 10 * 2})
  },
  //工点code码生成
  codeByProjectId(parmes) {
    return axios.get(`${apiUrl.base}/v1/WorkstationLedger/generateCodeByProjectId/${parmes.projectId}`, '')
  },
  //批量设置风险类型
  setRiskType(parmes) {
    return axios.post(`${apiUrl.base}/v1/WorkstationLedger/batchEditRistType`, parmes)
  },
  //同时查询多个风险类型下的风险作业
  listByRiskTypeIds(parmes) {
    return axios.post(`${apiUrl.risk}v1/riskInfoLib/listByRiskTypeIds`, parmes)
  },
  //同时查询多个风险类型下的风险作业11
  getByPointIds(parmes) {
    return axios.post(`${apiUrl.risk}v1/RiskOrderOrigin/getByPointId`, parmes)
  }
}
export default WorkstationLedger
